<template>
	<u-navbar :back-text-style="{color: '#fff'}" :title-width="400" :back-text="backText" :title="title" :title-color="titleColor"
	    :back-icon-color="backIconColor"
		:background="{
			backgroundColor,
		}"
		:custom-back="customBack"
		:is-back="isBack"
		:border-bottom="borderBottom"
		>
		<slot name="slot-wrap"></slot>
		<template slot="right">
			<slot name="right"></slot>
		</template>
	</u-navbar>
</template>
<script>
	export default {
		name: 'HNavBar',
		props: {
			backText: {
				type: String,
				default: '返回'
			},
			title: {
				type: String,
				default: ''
			},
			backgroundColor: {
				type: String,
				default: '#2979ff'
			},
			backIconColor: {
				type: String,
				default: '#fff'
			},
			delta: {
				type: [String, Number],
				default: 1
			},
			isBack: {
				type: Boolean,
				default: true
			},
			borderBottom: {
				type: Boolean,
				default: true
			},
			titleColor: {
				type: String,
				default: '#fff'
			}
		},
		methods: {
			customBack(){
				uni.navigateBack({
					delta: parseInt(this.delta)
				})
			}
		}
	}
</script>
<style lang="scss" scoped>

</style>
